<regex>: Remove error_syntax#5542
Merged
StephanTLavavej merged 1 commit intomicrosoft:mainfrom May 28, 2025
Merged
Conversation
StephanTLavavej
approved these changes
May 27, 2025
Comment on lines
575
to
578
| case regex_constants::_Error_parse: // TRANSITION, keeping behavior | ||
| return "regex_error(error_parse)"; | ||
| case regex_constants::error_syntax: | ||
| case regex_constants::_Error_syntax: | ||
| return "regex_error(error_syntax)"; |
Member
There was a problem hiding this comment.
No change requested: It would be more consistent to follow the pattern of commenting // TRANSITION, keeping behavior here, but the comment on the enumerator definition is sufficient. This isn't worth resetting testing.
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Member
😻 ❌ 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #438. There were two remaining uses of
error_syntax:?is essentially a quantifier applied to nothing, soerror_badrepeatseems an apt choice among the available codes to me. (The error codeerror_parenused by libstdc++ feels a bit weird to me in this context because this error code is intended for unbalanced parentheses, which this isn't.)_STL_INTERNAL_CHECK:_Alternative()only returns normally when_Mcharis_Meta_eos,_Meta_baror it is_Meta_rparwhile_Disj_count != 0. Its caller,_Disjunction(), only returns if_Mcharis not_Meta_barafter_Alternative()returned. So this means the error could only be thrown when_Mcharis_Meta_eosor_Meta_rparwith_Disj_count != 0. But in either case, this is a bug in the parser: Either_Meta_eoswas assigned to_Mcharbefore the end of the regex was reached (but see_Trans()for the only case where_Meta_eosis assigned) or an unbalanced number of increments and decrements toDisj_countwere performed.